<?php

use  yii\helpers\Url;
use  yii\helpers\Html;
?>
<main role="main">
	<?php echo $this->render('banner') ?>
	<div class="container-lg mt-5 mb-3 list-wrap">
		<div class="row">
			<div class="col-md-3 col-12">
				<div class="menu-second-wrap">
					<i class="iconfont icon-playcircle-fill"></i>
					<span class="parent-name"><?= Html::encode($menu->name) ?></span>
					<?php if ($sub_menu) { ?>
						<select name="" class="float-right" id="menu-second-select">
							<?php foreach ($sub_menu as $one => $first) : ?>
								<option value=""><?= Html::encode($first['label']) ?></option>
							<?php endforeach ?>
						</select>
					<?php } ?>
				</div>
				<?php if ($sub_menu) { ?>
					<ul id="menu-second-list" class="list-group">
						<?php foreach ($sub_menu as $one => $first) : ?>
							<?php if ($currentmenu->id == $first['id']) { ?>
								<li class="list-group-item active"><i class="iconfont icon-double-arrow"></i><a href="<?= Url::to(['site/menu', 'menu_id' => $currentmenu->id]) ?>"><?= Html::encode($first['label']) ?></a></li>
							<?php } else { ?>
								<li class="list-group-item"><i class="iconfont icon-double-arrow"></i><a href="<?= Url::to(['site/menu', 'menu_id' => $first['id']]) ?>"><?= Html::encode($first['label']) ?></a></li>
							<?php } ?>
						<?php endforeach ?>
					</ul>
				<?php } ?>
			</div>
			<div class="col-md-9">
				<div class="content-wrap">
					<div class="content-title border-bottom">
						<span class="title-icon"></span>
						<span class="ml-2 title-name"><?= Html::encode($currentmenu->name) ?></span>
						<div class="float-right">
							<i class="iconfont icon-map"></i>
							<nav aria-label="breadcrumb" class="d-inline-block">
								<ol class="breadcrumb">
									<li class="breadcrumb-item"><a href="/">网站首页</a></li>
									<?php if ($currentmenu->id == $menu->id) { ?>
										<li class="breadcrumb-item breadcrumb-2 active"><a href="<?= Url::to(['site/menu', 'menu_id' => $menu->id]) ?>"><?= Html::encode($menu->name) ?></a></li>
									<?php } else { ?>
										<li class="breadcrumb-item breadcrumb-2"><a href="<?= Url::to(['site/menu', 'menu_id' => $menu->id]) ?>"><?= Html::encode($menu->name) ?></a></li>
										<?php foreach ($sub_menu as $one => $first) : ?>
											<?php if ($first['id'] == $currentmenu->id) { ?>
												<li class="breadcrumb-item breadcrumb-3 active" aria-current="page"><a href="<?= Url::to(['site/menu','menu_id'=>$first['id']])?>"><?= Html::encode($first['label'])?></a></li>
											<?php } ?>
										<?php endforeach ?>
									<?php } ?>
								</ol>
							</nav>
						</div>
					</div>
					<div class="article-wrap">
						<h5 class="text-center"><?= Html::encode($content->title) ?></h5>
						<div class="text-center article-time-wrap pb-2 text-secondary">
							来源：<span class="pr-3"><?= Html::encode($content->from) ?></span>
							作者：<span class="pr-3"><?= Html::encode($content->auth) ?></span>
							发布时间：<span class="pr-3"><?= Html::encode($content->create_time) ?></span> 
							点击量：<span><?= Html::encode($content->times) ?></span></div>
						<div class="mt-2">
							<?= \yii\helpers\HtmlPurifier::process($content->content) ?>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<?php echo $this->render('linksub') ?>
</main>